<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <!-- if else判断 -->
    <script>
        var age = 12;
        if (age <= 12) { // 第一个判断
            alert("subei");
        } else if (age < 18) {   // 第二个判断
            alert("subeiLY");
        } else {  // 否则
            alert("NULL~~~");
        }
    </script>

    <!-- while循环 -->
    <script>
        var age = 12;
        while(age<100){
            age = age + 1;
            console.log(age);
        }

        do{
            age = age + 1;
            console.log(age);
        }while(age<100);
    </script>

    <!-- for循环 -->
    <script>
        for(let i=0;i<100;i++){
            console.log(i);
        }
    </script>

    <!-- for-each循环 -->
    <script>
        var arr = [1,232,14,43,34,34,314,];
        // for-each方法输入参数是函数
        arr.forEach(function (value){
            console.log(value)
        })
    </script>

    <!-- for……in——下标 -->
    <script>
        var age = [12,99,56,34,75,128,69];

        for(var num in age){
            if(age.hasOwnProperty(num)){
                console.log("存在！");
                console.log(age[num]);
            }
        }
    </script>
</head>
<body>

</body>
</html>